/*
 * @Author: 江舟 jijiangzhou@recycloud.cn
 * @Date: 2024-03-26 10:10:17
 * @LastEditors: 江舟 jijiangzhou@recycloud.cn
 * @LastEditTime: 2024-03-26 10:32:58
 * @FilePath: \vite-project\src\hooks\common\useOnce.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { useRef } from 'react';

export default function useOnce(callbak: () => void) {
	const isLoad = useRef<number>(0);
	if (!isLoad.current) {
		isLoad.current = 1;
		callbak?.();
	}
}
